package com.ruoyi.comment.service.impl;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

import com.alibaba.fastjson.JSONObject;
import com.ruoyi.comment.domain.CommentRelated;
import com.ruoyi.comment.mapper.CommentRelatedMapper;
import com.ruoyi.comment.service.ICommentRelatedService;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.comment.mapper.CommentMapper;
import com.ruoyi.comment.domain.Comment;
import com.ruoyi.comment.service.ICommentService;

/**
 * 评价记录Service业务层处理
 *
 * @author ch
 * @date 2021-11-24
 */
@Service
public class CommentRelatedServiceImpl implements ICommentRelatedService
{
    @Autowired
    private CommentRelatedMapper commentRelatedMapper;

    /**
     * 查询评价记录
     *
     * @param id 评价记录主键
     * @return 评价记录
     */
    @Override
    public CommentRelated selectCommentRelatedById(Long id)
    {
        return commentRelatedMapper.selectCommentRelatedById(id);
    }

    /**
     * 查询评价记录列表
     *
     * @param commentRelated 评价记录
     * @return 评价记录
     */
    @Override
    public List<CommentRelated> selectCommentRelatedList(CommentRelated commentRelated)
    {
        return commentRelatedMapper.selectCommentRelatedList(commentRelated);
    }

    /**
     * 新增评价记录
     *
     * @param commentRelated 评价记录
     * @return 结果
     */
    @Override
    public int insertCommentRelated(CommentRelated commentRelated)
    {
        commentRelated.setCreateTime(DateUtils.getNowDate());
        return commentRelatedMapper.insertCommentRelated(commentRelated);
    }

    @Override
    public int deleteCommentRelated(CommentRelated commentRelated)
    {
        return commentRelatedMapper.deleteCommentRelated(commentRelated);
    }


    /**
     * 删除评价记录信息
     *
     * @param id 评价记录主键
     * @return 结果
     */
    @Override
    public int deleteCommentRelatedById(Long id)
    {
        return commentRelatedMapper.deleteCommentRelatedById(id);
    }

}
